use serde::{Deserialize, Serialize};

use common::page::{BasePage, PageData};

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct CreateAccounts {
    pub accountname: Option<String>,
    pub password: Option<String>,
    pub qq: Option<String>,
    pub dzuid: Option<i32>,
}

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct AccountsPage {
    pub page_data: Option<PageData>,
    pub uid: Option<i32>,
    pub accountname: Option<String>,
    pub password: Option<String>,
    pub qq: Option<String>,
    pub dzuid: Option<i32>,
}
impl BasePage for AccountsPage {
    fn get_page_data(&self) -> PageData {
        match self.page_data.clone() {
            None => {
                PageData{
                    page: 1,
                    page_size: 10,
                    sorter: None,
                }
            }
            Some(page_data) => {
                page_data
            }
        }
    }
}


#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ResetPasswordModel {
    pub uid: i32,
    pub password: String,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RechargeBondsModel {
    pub recharge_type: i32,
    pub uid: i32,
    pub count: u32,
}
